package com.multicampus.minishop.services.product.impl;

import java.util.HashMap;

import com.multicampus.minishop.common.SearchVO;
import com.multicampus.minishop.product.vo.ProductVO;
import com.multicampus.minishop.services.product.ProductService;
import com.multicampus.minishop.services.product.dao.ProductDAO;

public class ProductServiceImpl implements ProductService {

	
	private ProductDAO dao;
	public ProductServiceImpl(){
		super();
		dao=new ProductDAO();
	}
	
	
	public ProductVO addProduct(ProductVO vo) throws Exception {
		try{
			vo = dao.insertProduct(vo);			
			
		}catch(Exception e){
			throw e;	
		}
		
		return vo;
	}
	

	public ProductVO getProduct(int prodNo)throws Exception {
		try{
			
			return dao.findProduct(prodNo);		
			
		}catch(Exception e){
			throw e;	
	
		}
		
	}

	public HashMap getProductList(SearchVO vo) throws Exception {
		try{
			
			return dao.getProductList(vo);		
			
		}catch(Exception e){
			throw e;	
	
		}
	}

	public ProductVO updateProduct(ProductVO vo) throws Exception  {
		try{
			
			dao.updateProduct(vo);		
			
		}catch(Exception e){
			throw e;	
	
		}
		return vo;
	}
	
}
